﻿using System.ComponentModel.DataAnnotations;

namespace Lin_shop.Models
{
    public class AddShopRequest
    {

        //验证规则 写在属性上方

        //是否必填 ErrorMessage指定如果验证不通过  错误提示
        [Required(ErrorMessage = "产品名称不为空")]
        //字符串长度限制StringLength
        [StringLength(50, ErrorMessage = "字符串不能大于50")]
        public string Name { get; set; }

        //必填
        [Required]
        
        public string Jj { get; set; }
        //规定一个数值范围 错误提示
        [Range(0, 999.99, ErrorMessage = "价格必须输入0-999.99")]
        public int Price { get; set; }
        public string Number { get; set; }
        public int ShopZt { get; set; }
        [Required(ErrorMessage ="请输入封面图")]
        public string Img { get; set; }
    }
}